package com.yangjun.controller.report;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.yangjun.service.report.CommodityFlowReprotExportService;
import com.yangjun.vo.report.CommodityFlowReportExportVO;

@RestController
@RequestMapping(value="/excel/comFlow")
public class CommodityFlowReprotExportController {
	
	@Autowired
	private CommodityFlowReprotExportService commodityFlowReprotExportService;
	
	@ResponseBody
	@RequestMapping("/getDeminsion")
	public Object getDeminsion(@RequestParam(value="reportid")String reportid,@RequestParam(value="userid")String userid){
		return commodityFlowReprotExportService.getDeminsion(reportid,userid);
	}
	@ResponseBody
	@RequestMapping("/queryDataByReportId")
	public Object queryDataByReportid(@RequestParam(value="reportid")String reportid){
		return commodityFlowReprotExportService.queryData(reportid);
	}
	@ResponseBody
	@RequestMapping("/queryData")
	public Object queryData(CommodityFlowReportExportVO cfreVo){
		return commodityFlowReprotExportService.queryData(cfreVo);
	}
	
	@ResponseBody
	@RequestMapping("/addReport")
	public Object addReport(CommodityFlowReportExportVO cfreVo){
		return commodityFlowReprotExportService.addOrUpdateReport(cfreVo);
	}
	
	
	@ResponseBody
	@RequestMapping("/addDownloadTaskByReportId")
	public Object addDownloadTaskByReportId(@RequestParam(value="reportid")String reportid,HttpServletRequest request){
		return commodityFlowReprotExportService.addDownloadTask(reportid,request);
	}	
	
	@ResponseBody
	@RequestMapping("/addDownloadTask")
	public Object addDownloadTask(CommodityFlowReportExportVO cfreVo,HttpServletRequest request){
		return commodityFlowReprotExportService.addDownloadTask(cfreVo,request); 
	}
	
}
